package com.yao.longhan.ui.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StyleRes;
import android.view.View;
import android.widget.TextView;

import com.yao.longhan.AppManager;
import com.yao.longhan.R;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by heyao on 2017/7/24.
 */

public class MyDialogHint extends Dialog {
    
    private Context context;

    @BindView(R.id.dialog_hint_text_context)
    TextView txtContext;

    public MyDialogHint(@NonNull Context context) {
        super(context);
        this.context = context;
    }

    public MyDialogHint(@NonNull Context context, @StyleRes int themeResId) {
        super(context, themeResId);
        this.context = context;
    }

    protected MyDialogHint(@NonNull Context context, boolean cancelable, @Nullable OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
        this.context = context;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.setContentView(R.layout.dialog_hint);
        ButterKnife.bind(this);
    }

    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.dialog_hint_text_yes:
                AppManager.getAppManager().AppExit(context);
            case R.id.dialog_hint_text_no:
                dismiss();
                break;
        }
    }
}
